﻿<?php

/**
 * Main file of the "mnml-blog" template for DokuWiki
 *
 *
 * LICENSE: This file is open source software (OSS) and may be copied under
 *          certain conditions. See COPYING file for details or try to contact
 *          the author(s) of this file in doubt.
 *
 * @license GPLv2 (http://www.gnu.org/licenses/gpl2.html)
 * @author Andreas Haerter <development@andreas-haerter.com>
 * @link http://andreas-haerter.com/projects/dokuwiki-template-mnml-blog
 * @link http://www.dokuwiki.org/template:mnml-blog
 * @link http://www.dokuwiki.org/devel:templates
 * @link http://www.dokuwiki.org/devel:coding_style
 * @link http://www.dokuwiki.org/devel:environment
 * @link http://www.dokuwiki.org/devel:action_modes
 */


//check if we are running within the DokuWiki environment
if (!defined("DOKU_INC")){
	die();
}


/**
 * Stores the name the current client used to login
 *
 * @var string
 * @author Andreas Haerter <development@andreas-haerter.com>
 */
$loginname = "";
if (!empty($conf["useacl"])){
	if (isset($_SERVER["REMOTE_USER"]) && //no empty() but isset(): "0" may be a valid username...
	$_SERVER["REMOTE_USER"] !== ""){
		$loginname = $_SERVER["REMOTE_USER"]; //$INFO["client"] would not work here (-> e.g. when
		//current IP differs from the one used to login)
	}
}


//get needed language array
include DOKU_TPLINC."lang/en/lang.php";
//overwrite English language values with available translations
if (!empty($conf["lang"]) &&
$conf["lang"] != "en" &&
file_exists(DOKU_TPLINC."/lang/".$conf["lang"]."/lang.php")){
	//get language file (partially translated language files are no problem
	//cause non translated stuff is still existing as English array value)
	include DOKU_TPLINC."/lang/".$conf["lang"]."/lang.php";
}


//detect revision
$rev = (int)$INFO["rev"]; //$INFO comes from the DokuWiki core
if ($rev < 1){
	$rev = (int)$INFO["lastmod"];
}

//workaround for the "jumping textarea" IE bug. CSS only fix not possible cause
//some DokuWiki JavaScript is triggering this bug, too. See the following for
//info:
//- <http://blog.andreas-haerter.com/2010/05/28/fix-msie-8-auto-scroll-textarea-css-width-percentage-bug>
//- <http://msdn.microsoft.com/library/cc817574.aspx>
if ($ACT === "edit" &&
!headers_sent()){
	header("X-UA-Compatible: IE=EmulateIE7");
}


/*********************
 *** START CONTENT ***
 *********************/


?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xml:lang="<?php echo hsc($conf["lang"]); ?>"
	lang="<?php echo hsc($conf["lang"]); ?>"
	dir="<?php echo hsc($lang["direction"]); ?>">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php tpl_pagetitle(); echo " - ".hsc($conf["title"]); ?></title>
<?php
//show meta-tags
tpl_metaheaders();
?>


<?php
if ($ACT !== "show" && //speed up: check most common action first
($ACT === "admin" ||
$ACT === "draft" ||
$ACT === "login" ||
$ACT === "register" ||
$ACT === "edit" ||
$ACT === "preview" ||
$ACT === "save" ||
$ACT === "conflict" ||
$ACT === "diff")){

	//SHOW SOMETHING NORMAL AND EXIT

	include("main2.php");

	exit();

}
?>

<?
/*
 echo "<link rel=\"stylesheet\" media=\"all\" type=\"text/css\"  src=\"".DOKU_TPL."user/rails.css\">\n";
 echo "<link rel=\"stylesheet\" media=\"all\" type=\"text/css\"  src=\"".DOKU_TPL."user/style1.css\">\n";
 echo "<link rel=\"stylesheet\" media=\"all\" type=\"text/css\"  src=\"".DOKU_TPL."user/style2.css\">\n";
 echo "<link rel=\"stylesheet\" media=\"all\" type=\"text/css\"  src=\"".DOKU_TPL."user/style3.css\">\n";
 echo "<link rel=\"stylesheet\" media=\"all\" type=\"text/css\"  src=\"".DOKU_TPL."user/style4.css\">\n";
 echo "<link rel=\"stylesheet\" media=\"all\" type=\"text/css\"  src=\"".DOKU_TPL."user/style5.css\">\n";
 echo "<link rel=\"stylesheet\" media=\"all\" type=\"text/css\"  src=\"".DOKU_TPL."user/style6.css\">\n";
 echo "<link rel=\"stylesheet\" media=\"all\" type=\"text/css\"  src=\"".DOKU_TPL."user/style7.css\">\n";
 echo "<link rel=\"stylesheet\" media=\"all\" type=\"text/css\"  src=\"".DOKU_TPL."user/style8.css\">\n";
 */
//include default or userdefined favicon
//
//note: since 2011-04-22 "Rincewind RC1", there is a core function named
//      "tpl_getFavicon()". But its functionality is not really fitting the
//      behaviour of this template, therefore I don't use it here exclusively.
echo "\n<link rel=\"shortcut icon\" href=\"".DOKU_TPL."img/favicon.ico\" />\n";

/**
 echo "<script type=\"text/javascript\" charset=\"utf-8\" src=\"".DOKU_TPL."user/jquery-1.4.2.min.js\"></script>\n";
 echo "<script type=\"text/javascript\" charset=\"utf-8\" src=\"".DOKU_TPL."user/hoverIntent.js\"></script>\n";
 echo "<script type=\"text/javascript\" charset=\"utf-8\" src=\"".DOKU_TPL."user/jquery.cycle.all.min.js\"></script>\n";
 echo "<script type=\"text/javascript\" charset=\"utf-8\" src=\"".DOKU_TPL."user/jquery.fancybox-1.3.4.pack.js\"></script>\n";
 echo "<script type=\"text/javascript\" charset=\"utf-8\" src=\"".DOKU_TPL."user/jquery.swfobject-1.1.1.min.js\"></script>\n";
 echo "<script type=\"text/javascript\" charset=\"utf-8\" src=\"".DOKU_TPL."user/jrails.js\"></script>\n";
 echo "<script type=\"text/javascript\" charset=\"utf-8\" src=\"".DOKU_TPL."user/superfish.js\"></script>\n";
 echo "<script type=\"text/javascript\" charset=\"utf-8\" src=\"".DOKU_TPL."user/tooltip.js\"></script>\n";
 echo "<script type=\"text/javascript\" charset=\"utf-8\" src=\"".DOKU_TPL."user/moreJS.js\"></script>\n";

 */

?>
<!--[if lt IE 7]><style type="text/css">img { behavior: url(<?php echo DOKU_TPL; ?>js/iepngfix/iepngfix.htc); }</style><![endif]-->
</head>
<?


/*********************
 *** START BODY ***
 *********************/


?>
<body>

	<div class="page_margins">
		<div class="page">

			<!-- START HEADER -->
			<div id="header">
				<!-- START OBEN RECHTS HEAD NAV -->
				<a accesskey="O" name="seitenanfang" id="seitenanfang"></a> <a
					href="http://www.fu-berlin.de/" accesskey="H" id="fu_logo"
					title="Zur Startseite der Freien Universität Berlin"><img
					alt="Logo der Freien Universität Berlin"
					src="<? echo DOKU_TPL."img/fu_logo.gif"; ?>" /> </a>
				<h1 class="hideme">Freie Universität Berlin</h1>
				<hr class="hideme" />
				<div id="topnav">
					<a class="skip" title="skip link" href="#content">Springe direkt zu
						Inhalt</a><span class="hideme">.</span>
					<h2 class="hideme">Service-Navigation</h2>
					<ul>
						<li><a href="/"
							title="Zur Startseite von:  Freie Universität Berlin">Startseite</a>
						</li>
						<li><a href="doku.php?id=kontakt" title="">Kontakt</a></li>
						<li><a href="doku.php?id=kontakt" title="">Impressum</a></li>
						<li><a href="doku.php?id=sitemap" title="">Sitemap</a></li>
					</ul>
				</div>
				<!-- END OBEN RECHTS HEAD NAV -->


				<!-- START OBEN RECHTS SEARCH ETC. NAV -->
				<div id="services">

					<!-- deactivated because javascript removed 
    <div id="service_menue">
       <a id="service_menue_link" href="/_elemente_fuer_startseite/direktzugang/" title="Direktzugang">Direktzugang</a>
     </div>
-->

					<!-- NEW SEARCH -->

					<div id="search" class="search">
						<div id="search_inner">
							<form action="doku.php" id="dw__search" accept-charset="utf-8"
								method="get">
								<input type="hidden" name="do" value="search" /> <input
									class="search_input" id="qsearch__in" name="q"
									title="Suchbegriff bitte hier eingeben" type="text"
									value="Suchbegriff" autocomplete="off" /> <input
									alt="Suchanfrage starten" class="search_button"
									id="search_button"
									src="<? echo DOKU_TPL."img/search_button.gif"; ?>"
									title="Suchanfrage starten" type="image" value="Suche" />
								<div id="qsearch__out" class="ajax_qsearch JSpopup"></div>
							</form>
						</div>
					</div>
					<!-- NEW SEARCH END -->


					<div id="icons">

						<a href="#print" onclick="javascript:self.print();return false;"
							title="Diese Seite drucken"><img alt="Drucken (Miniaturbild)"
							id="icon_print" src="<? echo DOKU_TPL."img/icon_print.gif"; ?>"
							title="" /> </a> <a href="" target="_blank"
							title="RSS-Feed abonnieren"><img alt="RSS (Miniaturbild)"
							id="icon_rss" src="<? echo DOKU_TPL."img/icon_rss.gif"; ?>"
							title="" /> </a>
					</div>
					<!-- #icons -->


				</div>
				<!-- #services -->
				<!-- END OBEN RECHTS SEARCH ETC. NAV -->

			</div>
			<!-- END HEADER -->

			<!-- START IDENTITY DESIGN -->
			<div class="identity_text  identity_text_border_bottom">
				<h2>
					<a href="/sites/cd/index.html" class="active"
						title="Zur Startseite von:  Corporate Design">Sommeruni</a>
				</h2>
			</div>

			<!-- END IDENTITY DESIGN -->


			<!-- START MAIN -->
			<div id="main" class="page_raster_10_off">


				<div class="subcolumns margin_bottom">





					<!-- begin: sidebar_left -->
					<div class="c20l">


					<?


					//we have to show a custom navigation

					//get the rendered content of the defined wiki article to use as custom navigation
			  $namespace = substr($_GET['id'],0,strrpos($_GET['id'], ":")); //TODO GET NAMESPACE TO SHOW DIFFERENT MENUS
			  $navpage = $namespace.":"."sidebarnav";
			  $interim = tpl_include_page($navpage, false);
			  if ($interim === "" || $interim === false){
			  	//try default navbar
			  	$interim = tpl_include_page("sidebarnav", false);
			  }if ($interim === "" || $interim === false){
			  	//show creation/edit link if the defined page got no content
			  	echo "[&#160;";
			  	tpl_pagelink($navpage, hsc($lang["mnmlblog_fillplaceholder"]." (".$navpage.")"));
			  	echo "&#160;]<br />";
			  }else{
			  	//show the rendered page content
			  	echo $interim;
			  }


			  ?>
			  <?
			  /* OLD NAVBAR MENU
			   <!-- begin level '3' -->
			   <ul class="vlist">
			   <li><a href="">Startseite</a></li>
			   <li class="active"><span>Sommeruni</span>
			   <!-- begin level '2' -->
			   <ul class="">
			   <li><a href="/">Programm</a></li>
			   <li><a href="/">Anmeldung</a></li>
			   <li><a href="/">Information</a></li>
			   <li><a href="/">FAQ</a></li>
			   </ul>
			   <!-- end level '2' -->
			   </li>
			   <li><a href="">Feedback</a></li>
			   <li><a href="">Bilder</a></li>
			   <li><a href="">Kontakt</a></li>
			   <li><a href="">Archiv</a></li>
			   </ul>
			   <!-- end level '3' -->
			   <div class="margin_bottom_30">
			   <div class="subc links_box_left">
			   <h3 class="label_small padding_left">Links zum Thema</h3>
			   <ul class="link_list_arrow_small na_list">
			   <li><a href="" title="">Link 1</a></li>
			   <li><a href="" title="">Link 2</a></li>
			   <li><a href="" title="">Link 3</a></li>
			    
			   </ul>
			   </div>    </div>

			   */
			  ?>



					</div>
					<!-- class="c20l"-->
					<!-- end: sidebar_left -->




					<div class="c60l" id="main_content">
						<!-- MAIN PAGE IMAGE -->
						<div class="strip_image">
							<a href="doku.php"><img alt=""
								src="<? echo DOKU_TPL."img/sommeruni-logo.png"; ?>" title="" />
							</a>
						</div>
						<div class="subc subc_default_padding">

							<!-- START BREAD -->
							<div class="breadcrumbs">
								<ul>
									<li class="first"><?
									tpl_breadcrumbs("</li><li>");
									?>
									</li>
								</ul>
							</div>
							<!-- END BREAD -->

							<!-- START CONTENT -->

							<?php html_msgarea()?>
							<?php
							$toc = tpl_toc(true);
							if ($toc){
								echo $toc;
								echo "<div class=\"clearer\"></div>\n";
							} ?>
							<!-- start rendered page content -->
							
							
							<?php
							//send already created content to get a faster page rendering on the client
							tpl_flush();
							//show page content
							tpl_content(false);
							?>




							<!-- END CONTENT -->







							<!-- class="site_functions box_border_top" -->
							<noscript>
								<div id="warningBox">
									<h4>Für eine optimale Darstellung dieser Seite aktivieren Sie
										bitte JavaScript!</h4>
								</div>
							</noscript>

						</div>
						<!-- class="subc subc_default_padding" -->
					</div>



				</div>
				<!-- class="subcolumns margin_bottom equalize" -->

			</div>
			<!-- END MAIN -->


			<!-- START FOOTER --->
			<div id="footer">


				<div class="subcolumns" id="bottomnav">
					<div class="subc padding_left padding_right">
						<!-- <a href="" title="">Link 1</a> -->
					<? echo tpl_pageinfo(); ?>

						<ul>
						<?
						if (!empty($loginname)){
							echo "<li> ";
							tpl_userinfo();
							echo "</li>";
						}
						?>

						<?php
						echo "<li>";
						tpl_actionlink("login"); //"login" handles both login/logout
						if (!empty($INFO["writable"])){ //$INFO comes from DokuWiki core
							echo "</li><li>";
							tpl_actionlink("edit"); //"edit" handles edit/create/show
						}
						if (!empty($INFO["isadmin"]) ||  //$INFO comes from DokuWiki core
						!empty($INFO["ismanager"])){
							echo "</li><li>";
							tpl_actionlink("admin");
						}
						if (!empty($loginname)){
							echo "</li><li>";
							tpl_actionlink("profile");
						}
						echo "</li>";
						?>
						</ul>
					</div>
				</div>

			</div>
			<!-- END FOOTER --->

		</div>
		<!-- #page -->
	</div>
	<!-- #page_margins -->
	<?php
	//provide DokuWiki housekeeping, required in all templates
	tpl_indexerWebBug();

	?>
</body>
</html>
